 package constants;

 import configs.ServerConfig;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import tools.PropertyTool;
import tools.Triple;

import java.io.FileInputStream;
import java.io.IOException;
import java.util.*;
import java.util.stream.Collectors;















 public class ServerConstants
 {
   public static final int MIN_MTS = 150;
   public static final int MTS_BASE = 0;
   public static final int MTS_TAX = 5;
   public static final int MTS_MESO = 2500;
/*  24 */   public static final List<String> localhostIP = new LinkedList<>(); public static final List<String> vpnIp = new LinkedList<>();

   public static final int MAXIMUM_CONNECTIONS = 1000;
   public static final boolean GMS = false;
/*  28 */   public static final byte[] NEXON_IP = new byte[]{(byte) 0xDD, (byte) 0xE7, (byte) 0x82, (byte) 0x46}; //singapore


/*  31 */   public static final String[] JOB_NAMELIST = new String[] { "反抗者", "冒险家", "骑士团", "战神", "龙神", "双弩精灵", "恶魔猎手", "幻影神偷", "暗影双刀", "米哈尔", "夜光法师", "狂龙战士", "萌爆天使", "火炮手", "尖兵", "神之子", "隐月", "品克缤", "超能力者", "魔链影士", "圣晶使徒", "影魂异人", "古迹猎人", "虎影", "御剑骑士", "龙的传人", "剑豪", "阴阳师", "林之灵" };
/*  32 */   public static final Triple<String, Integer, Boolean>[] backgrounds = (Triple<String, Integer, Boolean>[])new Triple[0];
/*  33 */   private static final Logger log = LogManager.getLogger(ServerConstants.class.getName());

/*  35 */   private static final Map<String, Boolean> blockedOpcodes = new HashMap<>();
/*  36 */   private static final Map<String, Boolean> blockedMapFM = new HashMap<>();
   public static String 服务器授权;
   public static boolean TESPIA = false;
/*  39 */   public static String HOST = "221.231.130.70";

   public static boolean PollEnabled = false;

/*  43 */   public static String Poll_Question = "Are you mudkiz?";
/*  44 */   public static String[] Poll_Answers = new String[] { "test1", "test2", "test3" };
   private static boolean showGMMessage = false;
/*  46 */   public static long SERVER_FLAG = 0L;

   static {
/*  49 */     localhostIP.add("221.231.130.70"); int i;
/*  50 */     for (i = 0; i < 256; i++) {
/*  51 */       vpnIp.add("221.231.130." + i);
     }
/*  53 */     for (i = 0; i < 256; i++) {
/*  54 */       vpnIp.add("17.1.1." + i);
     }
/*  56 */     for (i = 0; i < 256; i++) {
/*  57 */       vpnIp.add("17.1.2." + i);
     }
   }

   public static boolean isIPLocalhost(String sessionIP) {
/*  62 */     return localhostIP.contains(sessionIP.replace("/", ""));
   }

   public static boolean isVpn(String sessionIP) {
/*  66 */     return vpnIp.contains(sessionIP.replace("/", ""));
   }




   public static void loadBlockedMapFM() {
/*  73 */     blockedMapFM.clear();
/*  74 */     Properties settings = new Properties();
     try {
/*  76 */       FileInputStream fis = new FileInputStream("config\\blockMapFM.ini");
/*  77 */       settings.load(fis);
/*  78 */       fis.close();
/*  79 */     } catch (IOException ex) {
/*  80 */       log.error("加载 blockMapFM.ini 配置出错", ex);
     }
/*  82 */     PropertyTool propTool = new PropertyTool(settings);
/*  83 */     for (Map.Entry<Object, Object> entry : settings.entrySet()) {
/*  84 */       String property = (String)entry.getKey();
/*  85 */       blockedMapFM.put(property, Boolean.valueOf((propTool.getSettingInt(property, 0) > 0)));
     }
   }




   public static boolean isBlockedMapFM(int skillId) {
/*  93 */     if (blockedMapFM.containsKey(String.valueOf(skillId))) {
/*  94 */       return ((Boolean)blockedMapFM.get(String.valueOf(skillId))).booleanValue();
     }
/*  96 */     return false;
   }

   public static boolean isShowPacket() {
/* 100 */     return ServerConfig.DEBUG_MODE;
   }

   public static boolean isShowGMMessage() {
/* 104 */     return showGMMessage;
   }

   public static void setShowGMMessage(boolean b) {
/* 108 */     showGMMessage = b;
   }

   public static boolean isPvpMap(int mapid) {
/* 112 */     return (ServerConfig.CHANNEL_PVPMAPS.indexOf(mapid + "") != -1);
   }

   public static int getMTSNpcID() {
/* 116 */     return Integer.valueOf(ServerConfig.CHANNEL_ENTERNPC_MTS.split("_")[0]).intValue();
   }

   public static String getMTSNpcID_Mode() {
/* 120 */     return ServerConfig.CHANNEL_ENTERNPC_MTS.contains("_") ? ServerConfig.CHANNEL_ENTERNPC_MTS.split("_")[1] : null;
   }

   public static int getCSNpcID() {
/* 124 */     if (ServerConfig.CHANNEL_ENTERNPC_CASHSHOP.isEmpty()) {
/* 125 */       return 0;
     }
/* 127 */     return Integer.valueOf(ServerConfig.CHANNEL_ENTERNPC_CASHSHOP.split("_")[0]).intValue();
   }

   public static String getCSNpcID_Mode() {
/* 131 */     return ServerConfig.CHANNEL_ENTERNPC_CASHSHOP.contains("_") ? ServerConfig.CHANNEL_ENTERNPC_CASHSHOP.split("_")[1] : null;
   }

   public static boolean isOpenJob(String jobname) {
/* 135 */     return !ServerConfig.WORLD_CLOSEJOBS.contains(jobname);
   }

   public enum MapleServerType
   {
/* 140 */     UNKNOWN(-1),
/* 141 */     JAPAN(3),
/* 142 */     CHINA(4),
/* 143 */     TEST(5),
/* 144 */     TAIWAN(6),
/* 145 */     SEA(7),
/* 146 */     GLOBAL(8),
/* 147 */     BRAZIL(9);
     final byte type;

     MapleServerType(int type) {
/* 151 */       this.type = (byte)type;
     }

     public static MapleServerType getByType(byte type) {
/* 155 */       for (MapleServerType l : values()) {
/* 156 */         if (l.getType() == type) {
/* 157 */           return l;
         }
       }
/* 160 */       return UNKNOWN;
     }

     public byte getType() {
/* 164 */       return this.type;
     }
   }

   public enum MapleStatusInfo
   {
/* 170 */     获得道具(0),

/* 172 */     更新任务状态(1),
/* 173 */     MS_QuestRecordMessageAddValidCheck(2),

/* 175 */     商城道具到期(3),

/* 177 */     获得经验(4),

/* 179 */     获得SP(5),

/* 181 */     获得人气(6),

/* 183 */     获得金币(7),

/* 185 */     获得家族点(8),

/* 187 */     获得贡献度(9),

/* 189 */     显示消耗品描述(10),

/* 191 */     非商城道具到期(11),

/* 193 */     系统红字公告(12),

/* 195 */     更新任务信息(14),

/* 197 */     更新任务信息2(15),

/* 199 */     技能到期(19),

/* 201 */     获得倾向熟练度(22),
/* 202 */     超过今天可获得倾向熟练度(23),

/* 204 */     移除机器人心脏(24),

/* 206 */     休息后恢复了疲劳度(25),


/* 209 */     系统灰字公告(26),

/* 211 */     配偶提示(28),

/* 213 */     神之子不能获得金币(36),

/* 215 */     获得WP(37),

/* 217 */     不能获得更多的WP(38),

/* 219 */     连续击杀(39),

/* 221 */     星星奖励(212),
/* 222 */     星星奖励_领取(215);
     final byte type;

     MapleStatusInfo(int type) {
/* 226 */       this.type = (byte)type;
     }

     public byte getType() {
/* 230 */       return this.type;
     }
   }

   public enum MapleServerName
   {
    蓝蜗牛,
    蘑菇仔,
    绿水灵,
    漂漂猪,
    小青蛇,
    红螃蟹,
    大海龟,
    章鱼怪,
    顽皮猴,
    星精灵,
    胖企鹅,
    白雪人,
    石头人,
    紫色猫,
    大灰狼,
    小白兔,
    喷火龙,
    火野猪,
    青鳄鱼,
    花蘑菇,
    祖母绿(0x1E),
    黑水晶,
    水晶钻,
    黄水晶,
    蓝水晶,
    紫水晶,
    海蓝石,
    蛋白石,
    石榴石,
    月石川,
    星石申,
    黄金粤,
    黑珍珠,
    猫眼石,
    火星石,
    玛丽亚(0x3C),
    阿勒斯,
    薇薇安,
    月妙,
    七星剑(0x5A),
    明珠港(0x78),
    童话村,
    玩具城,
    里恩,
    飞花院,
    埃德尔,
    斯坦,
    匠人街,
    神木村,
    埃欧雷,
    阿斯旺,
    万神殿,
    镜世界;

    private final int value;

    MapleServerName() {
        this(Counter.nextvalue);
    }

    MapleServerName(int value) {
        this.value = value;
        Counter.nextvalue = value + 1;
    }

    public static int getValueByOrdinal(int ordinal) {
        if (ordinal > values().length || ordinal < 0) {
            ordinal = 0;
        }
        return values()[ordinal].getValue();
    }

    public int getValue() {
        return value;
    }

    private static class Counter {
        private static int nextvalue = 0;
    }
   }

   public enum MapleServerStatus {
/* 318 */     无,
/* 319 */     活动,
/* 320 */     新服,
/* 321 */     热门;
   }

   public enum ChatColor {
/* 325 */     白色(0),
/* 326 */     绿色(1),
/* 327 */     粉色(2),
/* 328 */     橙色(3),
/* 329 */     紫色(4),
/* 330 */     浅绿色(5),
/* 331 */     灰色(6),
/* 332 */     黄色(7),
/* 333 */     浅黄色(8),
/* 334 */     白底黑字(10),
/* 335 */     红色(11),
/* 336 */     蓝底青字(12),
/* 337 */     藏青色(16),
/* 338 */     浅蓝色(20),
/* 339 */     黄底黑字(21),
/* 340 */     紫色黑体(28),
/* 341 */     暗黄底黑字(31),
/* 342 */     红底黄字(38);

     public static int DEFAULT_CHAT_COLOR;
     private int color;

     ChatColor(int color) {
/* 348 */       this.color = color;
     }

     public static String getChatColor(int color) {
/* 352 */       for (ChatColor chatColor : values()) {
/* 353 */         if (chatColor.color == color) {
/* 354 */           return chatColor.name();
         }
       }
/* 357 */       return 白色.name();
     }

     public static String getChatColorNames() {
/* 361 */       return Arrays.<ChatColor>stream(values()).map(chatColor -> chatColor.name() + ",").collect(Collectors.joining());
     }

     public static void updateDefault(int index) {
/* 365 */       DEFAULT_CHAT_COLOR = (values()[index]).color;
     }

     public int getColor() {
/* 369 */       return this.color;
     }
   }


   public enum ServerFlags
   {
/* 376 */     疲劳值系统,
/* 377 */     VIP频道,
/* 378 */     十倍经验,
/* 379 */     生成CDKEY,
/* 380 */     起源之塔(true),
/* 381 */     免维护费版,
/* 382 */     台湾服(16777216L);

     private boolean develop = false;

     private long mask;

     ServerFlags() {
/* 389 */       this.mask = (1 << ordinal());
     }

     ServerFlags(boolean develop) {
/* 393 */       this.develop = develop;
     }

     ServerFlags(long mask) {
/* 397 */       this.mask = mask;
     }

     public long getMask() {
/* 401 */       return this.mask;
     }

     public boolean check() {
/* 405 */       return ((ServerConstants.SERVER_FLAG & this.mask) == this.mask);
     }
   }
 }


/* Location:              C:\PGX\Server.jar!\constants\ServerConstants.class
 * Java compiler version: 8 (52.0)
 * JD-Core Version:       1.1.3
 */